//
//  personHearView.m
//  nmrsc
//
//  Created by xumckay on 16/1/12.
//  Copyright © 2016年 bric. All rights reserved.
//

#import "personHearView.h"

@implementation personHearView

-(instancetype)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
        
        NSUserDefaults *user=[[NSUserDefaults standardUserDefaults]objectForKey:@"user"];
        _imageView=[[UIImageView alloc]initWithFrame:self.bounds];
        [_imageView setImage:[UIImage imageNamed:@"personalBackImage"]];
        [self addSubview:_imageView];
        
        _nameLabel=[[UILabel alloc]initWithFrame:CGRectMake(90,27,kDeviceWidth/2,18)];
        _nameLabel.text=[user objectForKey:@"memberName"];
        _nameLabel.textAlignment=NSTextAlignmentLeft;
        _nameLabel.textColor=[UIColor whiteColor];
        _nameLabel.backgroundColor=[UIColor clearColor];
        _nameLabel.font=[UIFont systemFontOfSize:15];
        [self addSubview:_nameLabel];
        
        _levelLabel=[[UILabel alloc]initWithFrame:CGRectMake(90,frame.size.height/2,kDeviceWidth/2,15)];
        _levelLabel.text=@"砖石VIP会员";
        _levelLabel.textAlignment=NSTextAlignmentLeft;
        _levelLabel.textColor=[UIColor whiteColor];
        _levelLabel.backgroundColor=[UIColor clearColor];
        _levelLabel.font=[UIFont systemFontOfSize:15];
        [self  addSubview:_levelLabel];
        
        _managerAddressBtn=[[managerAddressBtn alloc]initWithFrame:CGRectMake(0,self.frame.size.height-27,kDeviceWidth-15,30)];
        [_managerAddressBtn setTitle:@"账户管理收货地址" forState:UIControlStateNormal];
        [_managerAddressBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_managerAddressBtn setImage:[UIImage imageNamed:@"right"] forState:UIControlStateNormal];
        _managerAddressBtn.titleLabel.font=[UIFont systemFontOfSize:12];
        _managerAddressBtn.titleLabel.textAlignment=NSTextAlignmentRight;
        [self  addSubview:_managerAddressBtn];
        
        _avatarView=[[UIImageView alloc]initWithFrame:CGRectMake(15,frame.size.height/2-30,60,60)];
        [_avatarView setImage:[UIImage imageNamed:@"personalAvatar"]];
        [self addSubview:_avatarView];
    }
    return self;
}

@end
